﻿Imports System.Data.SqlClient
Public Class ThemNguoiDung

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim con As SqlConnection = New SqlConnection()
        con.ConnectionString = Ketnoi.str
        con.Open()
        Dim cmd As SqlCommand = New SqlCommand()
        cmd.Connection = con
        Dim QuyenHan As String
        QuyenHan = Me.cboQuyenHan.SelectedItem.ToString()
        cmd.CommandText = "INSERT INTO QuanLyNguoiDung VALUES('" + txtTenDangNhap.Text + "','" + txtMatKhau.Text + "','" + QuyenHan + "')"
        cmd.ExecuteNonQuery()
        con.Close()
        MessageBox.Show("Thêm Dữ Liệu Thành Công")
        Me.Close()
        Dim frm As New DangNhapNguoiDung()
        frm.Show()

    End Sub

    Private Sub btnThoat_Click(sender As System.Object, e As System.EventArgs) Handles btnThoat.Click
        Me.Close()
        Dim frm As New DangNhapNguoiDung()
        frm.Show()
    End Sub
End Class